1. Technical Field
This invention relates to a method of revising NC programs for a four-axis lathe having two tool rests. More particularly, the invention relates to an NC program revision method in which, if the tool rests are going to interfere with each other, the NC programs are revised in such a manner that the interference will not occur.
2. Background Art
An NC four-axis lathe is provided with first and second NC programs having wait commands corresponding to respective ones of first and second tool rests. While synchronization is achieved by the wait commands, movement of the corresponding tool rests is controlled independently by the first and second NC programs to subject a workpiece to machining.
FIG. 5 shows an example of first and second NC programs 1, 2 in an NC four-axis lathe. The programs respectively include program numbers 1a, 2a, program portions 1b, 2b for executing a first machining operation, first wait commands 1c, 2c, program portions 1d, 2d for executing a second machining operation, second wait commands 1e, 2e, program portions 1f, 2f for executing a third machining operation, third wait commands 1g, 2g, program portions 1h, 2h for executing a fourth machining operation, fourth wait commands 1i, 2i, program portions 1j, 2j for executing a fifth machining operation, and tape end commands 1k, 2k.
In accordance with the first and second NC programs 1, 2, the first and second tool rests machine a workpiece simultaneously (simultaneous independent operation) according to the program portions 1b, 2b, and, in response to the first wait command "M100", the tool rest which finishes the machining operation first waits until the other NC controller reads in the first wait command "M100".
When the other NC controller reads in "M100", the simultaneous independent operation is performed according to the program portions 1d, 2d. In response to the second wait command "M200", the tool rest which finishes the machining operation first waits until the other NC controller reads in the second wait command "M200".
When the other NC controller reads in "M200", the simultaneous independent operation is performed according to the program portions 1f, 2f. Note that since the program portion 1f is blank, the first tool rest immediately assumes a waiting state in response to the third wait command "M300", and only the second tool rest performs machining according to the program portion 2f.
When machining by the second tool rest ends and the third wait command "M300" is read in, the simultaneous independent operation starts in accordance with the program portions 1h, 2h. Thereafter, this four-axis lathe control is performed in a similar manner, with simultaneous four-axis machining being ended in response to the tape end commands M30.
Thus, with a four-axis lathe having two tool rests, the tool rests can be controlled and moved independently. Such a lathe is advantageous in that e.g. the outer diameter of a workpiece 13 (see FIG. 6) can be cut by a tool 12 mounted on one tool rest 11 and the inner diameter of the workpiece can be cut by a tool 22 mounted on the other tool rest 21. This enables machining time to be curtailed.
However, in a case where the two tool rests 11, 21 carry out machining simultaneously, a situation can arise, due to a program command error, in which the two tool rests (inclusive of their tools) collide. Since such a collision must be avoided at all costs, the conventional practice is to check prior to actual machining whether or not the two tool rests will collide (this is referred to as an "interference check"), and revising the first and second NC programs corresponding to the tool rests if a collision occurs.
The interference check for determining whether the two tool rests will coolide is performed as follows in the prior art:
As shown by the dashed lines in FIGS. 7(A) and 7(B) the shapes of the tools 12, 22 and tool rests 11, 21 are defined (approximated) as rectangular regions, whether these two rectangles will overlap is checked, and it is deemed that interference will take place if overlapping occurs. This operation is performed with regard to all tools mounted on the tool rests. The only reason for thus defining the shapes as rectangles is that checking for the overlapping of rectangles involves comparatively simple calculations. Preferably, figures conforming to the actual shapes should be checked for overlapping, but this is not realistic due to the complicated calculations involved. Recently, however, it has become possible to input a figure conforming to actual shape into an NC unit with regard to every tool, and to check thee figures for overlapping. In other words, since a CRT capable of displaying color graphics may now be installed in an NC unit, each tool is displayed in a separate color and an interference check can readily be formed based on whether or not the two color displays overlap.
If tool interference is going to occur, the NC programs must be revised in such a manner that the interference will not be allowed to happen. In the prior art, however, an NC program cannot be revised automatically. As a result, the revision operation is a troublesome one and requires an extended period of time.